package com.woniuxy01;

import java.util.Comparator;

/**
 * @author 作者
 * @create 2025-11-04 10:18
 */
public class StudentNameAscComparotor implements Comparator {
    @Override
    public int compare(Object o1, Object o2) {
        if(o1 instanceof Student && o2 instanceof Student){
            Student one= (Student) o1;
            Student other= (Student) o2;
            return one.getSname().compareTo(other.getSname());
        }
        return -1;
    }
}
